Added helper function to attach the same command to a list of events