fixes problems when current directory isn't writable
make sure that default workdir is current directory