moved away from calls to exit inside redirect() and error(), wip