removing deprecated tempfile in favour of mktemp: http://goo.gl/l9G3Wy