added some debug logging
fixed to_command_spec
make sure digest is passed