improving clearing of the session