fixed small issue with register event