handle deprecation warning from 2.7