Move the logic up so the continues work