fix for getElementAttribute returning null if the value is an empty string