fix stack problem