finish interactive function.