removed bug from handleFiles.js and added error callback to xhr