Provided that no such attachment shall defeat or prejudice any debt for which the funds attached were previously pledged in accordance with law; but all such prior charges shall be paid out of the proceeds of the funds before any part of the proceeds is applied to the satisfaction of the liability in respect of which such attachment is made.