made agent constructor error message more informative