fix typo in if block