Fixed checking for PI