finally fixed ssl bug