Event adding function implemented