Put switch inside autoreleasepool