added 'then' after the if statements