fixed adding agents out of bounds