added if n undefined on hoops.endon