Remove deprecated function call, by using new framework method