fixed shutdown error