improve ping api
use ping() in setPing()