Updated Node script for errors