fixed null pointer error

Change-Id: Ic7732ab42fe235e9145b8f484abce1212f1cebb4