Changed emit method to yield