Update JS for Firefox compatibility