add merge function to server