fixed bugs in updatelocation

Signed-off-by: Ryeyao <rye.y.cn@gmail.com>