may need to check if errors should be sent to stderr or not