add console logging for error messages