If any such action is commenced without filing such written instrument, the court, on motion, shall dismiss the same, and the attorney of the plaintiff shall pay all costs accruing thereon, unless the security for costs is filed within such time as is allowed by the court, and when so filed it shall relate back to the commencement of the action; the right to require security for costs shall not be waived by any proceeding in the action.
735 ILCS 5/5-103