added state setting, changing icon and tooltip