Fixed result not defined error in fs.js