fix bug to support insure input directory