lastID for search and sorting