fixed logic error while loading behaviors into the ArrayList