Added URL encoding for params