add locate logic