updated to fix deprecation warnings