Fix stack exploding issue