Fix deprecated warning