url needs to be encoded before passing as parameter