fix events array issue