fixed bug with events in parser