fix filename undefined error