fix bug when calling callback in create_thread