fix last chunk