restored valid checks for gp and pg