restore old code to cmdline tool