modify the function