added events and helpera routines