fix for wtr.tmp instead of wtr ref