Added Session management
Bugfixes