Make cleanQuery run after middleware

Signed-off-by: Ian Macalinao <me@ian.pw>
Merge pull request #54 from simplyianm/master

Make cleanQuery run after middleware