added error log and removed stacktrace printing