Use communicate so as not to lock up the subprocess