humm , shouldn't include chan < 0 in that case and should be taken care in chan != -1