allow adding directories

and fix output