If, after such payment, there is any sum remaining of the proceeds of the sheriff's foreclosure sale, the court shall thereupon try and determine the other issues in the suit in accordance with section 141.480. If any answering parties have specially appealed as provided in section 141.570, the court shall retain the custody of such funds pending disposition of such appeal, and upon disposition of such appeal shall make such distribution. If there are not sufficient proceeds of the sale to pay all claims in any class described, the court shall order the same to be paid pro rata in accordance with the priorities.
§ 141.580, RSMo