fixed issues caused invalid header