Fix logout to keep port