Changed from tempfile to mktemp to support the redhat based AMI we use