fix storage routine