fix bugs of back propagation