modify gen-dir script