Fixed middleware issue.