Implemented proper session shutdown with closing of running apps