I’m glad to hear that it helped. This particular issue has come up before. Here’s another historical thread on essentially the same topic that is worth a look.
Here’s one with a more general discussion of back prop and the Chain Rule and has links to reference info.