handle data.credit when it's null