To fix the problem and update new function