bug fix for creating duplicate events