I'm getting 'TypeError: fname is undefined' errors at startup