moved last commit to before the flag handling