added support for sessions and stuff