added second if statement