Fixed temporary directory issue