[PD-dev] modified stack management