Updated to support latest API