partly fixed bug in connection refusal