fix derivative on tanh