handle null reference values exception