adding ping operatin and other various fixes