preventing null pointer error

Change-Id: Ic1fb0488de808e5619275ed11a7b844c731c95a4