added event driven stuff