Fixed the null pointer