Fix NullPointException error