Merging the database