grab resources out of pg properly