Added some Error Logging