Add conditional check for newapi