moved events to xinit