If it's your error, just correct and file an Amended Complaint under Federal Rule of Civil Procedure 15. You have a right to amend without permission if it is within 21 days after you served the complaint on defendant. Otherwise, you may amend the complaint only with defendant's written consent (usually called a stipulation which need to be "so ordered" by the judge) or with the court's leave. The the court is required to "freely" give leave when justice so requires.
Assuming that you have not previously amended your complaint and that a responsive pleading has not been served yet, then you may file an amended complaint. Otherwise, you can amend your complaint either by the written consent of the adverse party or by filing a motion for leave (of court) to file an amended complaint.
This attorney is licensed to practice law in the State of California. The laws of your jurisdiction may differ and thus this answer is for informational and educational purposes only and is not to be considered as legal advice. Since all facts are not addressed in the question, this answer could change depending on other significant and important facts. This answer in no way constitutes an attorney-client relationship.