this function can be potientially called numerous time, perhaps use  ASSERT here?