updating database and tables