preventing from saving invalid urls into de db