fixed the session problem, also removing orphans