finish_function
fix bug