moved ledger creation logic back to previous location. change was breaking