Fix deprecationwarning