fixed bug to encode url