Fixed for ref to print locally

Made ref use tee to output reference number to file and screen at once.