foreach with reference