fix a bug in optimizeAdgroupsStatus