Persistent connection; last command logic needs some work