move obj out of func scope in getStorage()