more error-checking