modify state and metric