add ability to pass redirect code