replace method deprecated