add nonblock support