post debug tidy-up