fixed a bug which made events duplicate in the active events part  sometimes