fix reversed boolean check