since we replace native functions, we also need a cleanup method that restores them