before modify pie