improve exception handling
print exception to stderr