fixes for backpropagation