Added a condition for the case when the address is null - doesn't throw exception now