fixed cross-browser js issues