Added stack overflow code