added callback to updateDatabase