bug fix in LDA