Fixed race conditions for FileEngine