bug fix / wait for file readiness