foreach ajax now works