if encryption failed, disconnect
add debug print to find bug with buffer_offset