Warning with null reference fixed