You need to put yourself back in charge of the resources (treats) so that will never ever happen again! A dog bite is a very serious matter.
The Nothing in Life is Free program is excellent:
Nothing in Life is Free Nothing in Life is Free Gaining control of your dog humanely