fix how temp directory write permissions are set