add foreach method