added code to handle various exceptions and also spouse relationship