Updatet the code.

There are still problems with removing the sessions. Working on it.