Moving fs.readdir into start function