adding pattern using event emitters