fixed logic bug in submitPledge script