adding error.js file to catch errors