Update directory.js

function missed closing brace