small fixes
middleware support