bugfix: end transfer length