cleanup, use SHUT_RDWR instead of 2