messed up boolean condition