added hook registering command and ping handling