Successfully created deadlock detector, but the method for fixing it is not working.