added session synch & removed bug with keyboard

I'm ready to accept the pull request. The commented-out code should be simply deleted (git takes care of it), then it's perfect. 
Really good work with the connection manager and the progress bar, thx!