Added event handlers for gui controls