Fix location updating functionality