check if pid is in the returned fields before trying to use it