pass emit as an argument