Switched to a newer version of a function that directly takes a handle.