You may be able to achieve a name change through your current litigation. Of course you initially chose not to tell us that you had a matter pending in court, and haven't described the nature of the hearing beyond it somehow relating to custody. You should consider consulting a lawyer.