finishing command detection