fixed dot bug in SGD