updated sample app code