fix bug and exports emit method