Trying to avoid a memory error