Fix the function signature for close_fun