Fixed issue of null pointer