Fixed cleanQuery error. cleanQuery call moved after middleware initialization to allow usage of populate and other options even when we are not using middleware.