fixed out of bounds string access

Change-Id: I25f53f16c3ddc3456c165b6c604911433f460228