added correct id counting