Fix deprecation warning