added second if statement.