Added Type Annotation for dispatchCommand