use debugout for errors instead of cerr