test lastIndexOf path instead of fileExtension