fix #209 and #21 with advanced search sort option