working on #17. Added periodical ping.