rewrite with copilot something went wrong