fixing firefox close bug