fixed native session model and threads shutdown.