improve the way to destroy a session