fixed compatibility issues IE and older API