Fixing generateUrl wich was redireting to an url