fix copy db bug