added progressbar and made login asynchronous