Add ForEach method for object