Okay, this code \'was\' working perfectly and then I started playing around with it in order to let others connect to their e-mails and as you do ran into a few open stream
I ran into this problem and here is how I solved it;
after this, above code works for me....