fixed the gradient