use post-command-hook because of optimizations