change tmp to live table for personal_pgd
add cleanup function