account for different event structures (chrome and firefox). Bug fix