some potential fixes to QByteArray crash