fixed scope on computeLocation()