foreach instead of map to avoid php 5.3 problems with $this