Fix bug with endpoint root undefined