added if statement to check URL

added if statement to check URL