random agent working finally