fix bugs in post-processing