added location save function