added assert to help deubg error