tried to fix sort/search bug: not working yet