fix issue with cutting of last letter of names for files without extensions