add view_number in get_thread function