patches for session feature