some changes for backward propagation