remove console.log
move on('error') above end()

doesn't seem to matter but still
tidy
move callback out of try catch