moved events to the top