fix problem with events KeyError