update database and index file