Bug fix

len(buf) was recalculated and skips the last 4 bytes from the buf