fix bug  #1809 by Li Ke