added a loop protector and avoided looking at private fields
...