fixed socket closing bug
set sessions to inactive before removing to work around angularjs bug
isabelle: include warnings, and typing