updated event handlers and fixed some bugs in scaffolding