made a few changes: does now use an event