Fix registering events sort