improved plan, fix bug in logging command