Fixed segfault

Change-Id: I873600aac2b3f0e45bc3a5f77404f1c2da8fbd1d