Fixed the waitForFile problem.