Ledger File Creation Bug Fix

In certain cases Ledger files were not properly being created... moved
the check and return to a lower nested block