Fix depreciation warning