added freeCredit function