improved stability functions