fixed bug with resource discovery