Merge function with new ui