Add deprecation warning and fix