Added second if statement with conditional