preprocessing events