Workaround for OutofMemoryException