Fixed a bug in the discovery endpoint