ticket:3 add middleware and view