fixed infinite credit bug