fixed the unload graphics bug, also added autoreleasepool