Fixing bug with checkboxes not toggling