fixed js bug in non-firefox browsers (closes #6)