Well it's not necessarily wrong to do that. Just wanted to make sure that you knew that you're only saved because of what Christ did on the cross. Repentance just means to change your mind, so if you confessed your sins to a church because you changed your mind about sin and confessed belief in The death burial and Resurrection of Jesus Christ prior to going to said church, you're good. Just want to make sure you didn't think confessing your sins at church saved you, it's important to know that no work is righteous. But that doesn't mean that no work can be pleasing to God now if you are saved