fix potential storage bugs