Your praise means a lot to your child. Children want to use the toilet because they want to please you and because they want to feel like they are growing up. You could help children see how well they are doing by putting stars or checkmarks on a calendar when they go to the potty on time. Accidents often happen because children do not want to stop playing. Children need to be reminded to stop their play to go to the bathroom.
Accidents sometimes happen because of extra stress in a child's life.
Bedtime is an especially important time for closeness and comfort. The accidents will probably stop on their own, as little by little, children adjust to the stresses. Many children already feel bad when they have had a toilet accident. Punishment could make children feel too ashamed to try next time. It could help to talk with a child-care provider or other parents for more ideas to try.