Fix for Safari HTMLElement issue