Added some error logging to help developers.