correct with_state method for model