add event output and bug fixes