updated validAddress method.