current working version, allows nonblocking event calls