improoved setting, unsetting and chehing