Corrected the boolean bug