os check added to ping function