fixed some bugs in ping