fix set last program after program is deleted