Removed test code
Implementing safe disconnect
Add newline to input