don't use foreach, doesn't work in older browsers