improved boolean handling