fixed some bugs, added secure connections again