Added log output on error