Added then to if statement.