add check that file extension is not null