tests fixed + middleware