adding ssl connection and fixing bugs caused by custom profile paths