renamed function decode_buffer to handleFrame