added brackets for if statement