Added one more check for input directory. Added recursive rebranding in subdirectories