made the working-directory change more OS flexible