fix credit count issue and reverted to last version before osgi