before dealing with search