changed query sequence in copy db to avoid hangs executing query + removed some prints