Added some error display to the console for debugging purposes