replaced usage of deprecated API with suggested substitutes