How to keep the same terminal-id after a connection was lost for a user?