basic error-checking