remove use of session and flash