Applied patch to resolve the deadlock