Add loader

 + bug fix logout support http and https