Added code for connecting to ews