Added an exception if ip address is null