better error message handling.