ERROR: undefined method `location' for nil:NilClass