fix loop variables