added autoreleasepool to reduce memory pressure