If the judgment is in favor of the defendant, the defendant shall recover costs and judgment shall be entered for the return to the defendant of the property distrained, unless the same has been replevied or released from such distress. If a counterclaim is interposed, and it is determined by the court that a balance is due from the plaintiff to the defendant, judgment shall be entered in favor of the defendant.
735 ILCS 5/9-310