merge_ping function