fix boolean condition