add feature : directory middleware