try to use more tasks in sample
fix sample middleware order