fixed crash in debug code

Change-Id: I254a1224ba3c5c97859def0277cd496d0dc48f6e