added url checks for invalid urls