fixed determine filename