properly parse events