implemented update for database