fix bugs in bandwidth monitoring to make it work with file transfer