Corrected stack overflow