replace the function with a working function