refs # Changed the update function to use incremental updates for database