CheckCredits function