Fixed url emebeding issue by encoding the url first