fix resetting last program on restart