cleanup
fixes to make database sessions work