updated random agent with error