fix stack underflow