must use pg for a number of function to work