merge_db.sh debugged