Fixed the even handlers