use a temp file for refs