fix problems with temp dir