added php loop