fixed bugs due to ssl change