fix bug in inner product