converting from sessions, more robust