fixed bug in firefox with mouse events