Fixed Error message and Error Logging