bug fix

critical bug was fixed in case of eof or connection abort