#8 and #26: fixed typo for search criteria and automatically add indices on sorting