Now the escape key will close the connection and terminate program.