fixed range request support

fixed the bug that lead to failed range request in some cases