Fixed a bug when middleware is this instead of desired exported object