Updated the pg command to a smarter one.