change to remove search index file at end
fix wrong cast type