modified code to work with address form