function to add the event field if it is not exist