content checking and error handling