Fixed a stack overflow