solved bug in setEvent