capture_command added with tests