Implemented async merge function