fix adding/updating events