Fix javascript error in Firefox