js file for event emit, emit do not work properly yet