fix bug in LR