fix boolean flip