fixing bug when no events