revised for multi-session