fix unexpected else in if statement