Added deadlock detector