fixed crash http -> https