fixed the error that file name is empty