using Popen instead of check_call