moved mktemp to var
fixed mktemp for linux