fix MemoryError in loaders