Typo. Moved endl outside loop.