Ummm...you fed them candy? Squeak loudly when they do it and firmly tell them no biting. If that doesn't get the message across, bop them gently on the nose too.
I actually hold the treats in the palm of my hand and my girls are very gentle about reaching in and taking one. I've made the mistake of trying to hand them a treat by holding it with my fingers and almost got my fingers snatched off. Now I put exactly 4 treats in my hand and each of my girls only takes one treat and I don't lose a finger. That's just the way I've taught my girls to do it and it works for us.Hold treat sideways,,so rattie cannot snatch it from fingers,,,,picture holding a coin on its edges,,,talk gently,,,,,,,make sure fingers are clean,,,,then open door,,,get treats,,,lure them out...that"s what I did with my first rat,,,,,still works