Fix for issue #2. I couldn't determine the cause of the output, but by separating the logic and having the save function (prior to JavaScript redirect... not pretty) applied as it's own branch in the conditional logic and the loading of the page content only happen when not applying a save we are able to bypass the problem and get a clean output.