added url option
added more checks