fix gradients