changed event model to make it compatible with IE.  Needs clean up