Add typeof to sortableString check