event emit now works