corrected the deprecation warnings