added check for debug mode

Change-Id: I7a853b051c3ad6b480df514337cf4359024cb5ab