added extension and directories options