fix bug when file w/o a file extension