rewrite event handling to deal with mulitple concurent events