add logging for error states