fixed rest_controller problem of updating location too late, thus never saving