fixed the boolean bug