Fixing bug with url encode