fixing deprecation warning

Changes a deprecated function warning.