fix spare search logic