make logic for checkbox header