added error logging to stdout