#9 some changes refer to closing connection