added if statement to check for values in url

added if statement to check for values in url