fix if statements and sds publishing