Little bug fix on events javascript.