fix storage logic