fixed error in automatic search