fixing an unfinished if