added proper-locking to poll event mode