- added missing end to condition