Fixed null pointer excaption.