Added updateDatabase() function