fixed assertion bug