fixed bug in 1D case