small bug fix

forgot to add a boolean check