fixed crash bug in stack