fixed bug in events helper