adjustments to the code to fix a few issues with redirects and passed params