fixed and improved patch identify url function