patched for deprecated function