preliminary error handling