Change deprecated function to next function