Fix getElementByTagName to getElementsByTagName. Proper implement wait for files