deprecation warning in correct place