Fix critical bug with DB storage