make emit function work with more than one arguments