minus 1 error in pi check

tried to fix minus 1 error in pi check