Apply arguments passed to emit to listener function