improve error controller handling
further improvements to error controller
remove unnecessary variables from session
fix issue with handling errors