add print function to events