add finish to cleanup pending state.