change url encoding logic