changed get_capabilities() to get agent capabilities after getting resource capabilities