Fix NameError in refresh method

`config_endpoint` was undefined in refresh method.