fixed ref to filename global variable