Modified tmp to scratch