fixed copy database bug