Fixed deadlock in scedule