trying to fix SIGINT error, tried locking the mutex before destroying