fix possible overread