added logic to check url