fix resolve and pay margin