Moved restart code

Moved the code to restart the execloop out of the execloop routine.