fix subdir bug where pre/post_install scripts can be invoked more than once