fixing pg calls