fix some bugs about location preference