dont itterate through agents if nil
add tests
change to spec
change to spec