using os instead of subprocess