fix wrong usage of each on object