What would be the point of asking for a deposit if has to be repaid even if you break the agreement? The entire reason for the deposit is that you'll lose it if you break the agreement, otherwise it would be pointless. Be thankful you got as much back as you did. They didn't do anything wrong here, you did.