fix events registration