correction of boolean condition