fix miscount issues