can register a final middleware