to update database