Moved events to main