run master loop