added dependencies
added save shutdown on unexpected error