bug fix on events implementation