added POT, fixed auto-sql for POT