Rename $main to $mainline to avoid confusion