fixed dom event handling in firefox (fix #52)