Fix deprecation error