fix bugs in inpost_hook