Fixed a bug when exporting without selecting a database