fix missing resource error (ubuntu 12.04)

Encountered an error with missing the temporary path. Relocating the statement outside of the if block fixed the error for me.