Added error handling so that Node doesn't crash