Make a synced refresh of workspace before reading generated file

Solves bug 3563