Fix if 'data' variable is a bytes-like object (decode utf-8 string)