Encode url properly on saving