encode url params correctly