putting wait for file creation hack back in, to see if it fixes a null pointer