Fixed error in how subprocess is used