fixed settings and middleware
Merge remote-tracking branch 'origin/master'