fixed ping function