bugfix for setCheckState method