initialize file var outside conditional block