fix filename on error