fixed issue with promises during file copy