Attempting to invoke check_output but failing