added some checks in p/g/a