modify setDatabase, loadConfig and add question about saving befor exit