Fixed stack overflow error.