replace a deprecated api call