fix non array middleware option

Passing a middleware as a non array didn't work due to wrong comparison in instanceof check