Fixing a boolean statement