change assert to memory leak error