fix potential race with notify(&block)