fix assertion bug