fix endpoint loading bug