fix event handler bug for firefox