added code for a directory with single file