added update/merge function