changed popen to check_call