implement finish command