fixed event polling in gui