removed a bug in loaddb where the store was not closed if load_all = False