replaced commands by subprocess