add generate for directory