Changed 'addr' to 'addr_str' in initial split() call to match function argument