add callback for cmd received, executed, and error