changed the code to make Firefox work