Fix Error Logging