update sample code: properly end input data list