[TS-3121] - Fixing the incorrect condition checking