fix the double counting problem