fix for copying database