Adjust if condition checking