fix the FIN handshake at the end so the main proc properly terminates