a little optimization of locate