Added Sanity Check for out of memory