Added saving of the database in localStorage