Updated to remove deprecation warnings