control + D closes socket anyways. no need to explicitly close