made redirect url optional