fixed sending error with nonblocking socket and event