fix unfinished if statement