changed logging to stderr