fix leftoverbytes