fix sample
try to support section and reversed section (not done) , add error handling