fix bug in sendfile