handle undefined model more gracefully
Fix default sorting without search term