fix programGenerator bug