fix logger middleware