fix bug in 1D