check filename first