Fix closing if statement