update master loop