Added code to update text files in the database