replaced tmp with temp