fix indent
pretty critical typo
re-adapt to class method
need return obj
looks like webgateway_tempfile still uses TMPROOT