no more memory loss , replaced free/malloc with delete/new , added ping