Fixing js issues in Firefox