Added patch to possible resolve deadlock.