fixing problems with wrong content leangth