Modifying checking url algorithm