Fix replaceStringInFileSpec by using async