added middleware auto-loading