ticket:3 created middleware and added it to settings