To prevent any person from avoiding or delaying his or her trial, it shall not be lawful to remove any prisoner on habeas corpus under X of this Act out of the county in which he or she is confined, within 15 days next preceding the first day of the calendar month in which such person ought to be tried unless it is done to convey him or her into the county where the offense with which he or she stands charged is properly cognizable.
735 ILCS 5/10-130