Fixing check for input directory