update pi correctly