<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_middleware(middleware: EFBMiddleware):
 """ Register a middleware with the coordinator. Args: middleware (EFBMiddleware):
 Middleware to register """

    global middlewares
    if isinstance(middleware, EFBMiddleware):
        middlewares.append(middleware)
    else:
        raise TypeError("Middleware instance is expected")