added parse url function