Fix runCommand so it can take input and respond faster by replacing the process