extend objects for safety. move event handling to init.js