adds events for checkbox