fixing validation for pg