updating to the new API