deadlock detection added