Slight fix avoiding collapsing sessions. Still have to fix database update