Fix for hang in Firefox