adding discovery logic