Fix deprecated API