fixed call-stack bug