bugfix: usage of deprecated setStatus
added new session handling + cleanup