changed temp files to mktemp to avoid name collisions
missed paste command for mktemp change