refactoring a SQL for find items
fix search state name