Revised for non-blocking