in case expectedType is array we dont want to flatten it all