The only way that you can keep your child "safe" is to not let them wander around with you in the woods, but then you will most likely have other problems. Sounds like you did a good job letting her see first hand what to do... Keep calm and shout "Hey bear"